import request from '@/utils/request'

export default {
  // 列表
  query(data) {
    return request({
      url: `/v1/finance/payment/list`,
      method: 'post',
      data
    })
  },
  // 编辑
  edit(data) {
    return request({
      url: `/v1/finance/payment/edit`,
      method: 'post',
      data
    })
  },
  // 批量审核
  batchAudit(data) {
    return request({
      url: `/v1/finance/payment/batch-audit`,
      method: 'post',
      data
    })
  },
  // 批量作废
  batchCancel(data) {
    return request({
      url: `/v1/finance/payment/batch-cancel`,
      method: 'post',
      data
    })
  },
  // 线上支付
  onlinePay(data) {
    return request({
      url: `/v1/finance/payment/online-pay`,
      method: 'post',
      data
    })
  },
  // 支付列表
  payList(data) {
    return request({
      url: `/v1/finance/payment/pay-list`,
      method: 'post',
      data
    })
  },
  // 批量删除效验失败数据
  batchDelete(data) {
    return request({
      url: `/v1/finance/payment/batch-delete`,
      method: 'post',
      data
    })
  },
  // 付款
  pay(data) {
    return request({
      url: `/v1/finance/payment/pay`,
      method: 'post',
      data
    })
  },
  // 效验
  check(data) {
    return request({
      url: `/v1/finance/payment/check`,
      method: 'post',
      data
    })
  },
  // 提交
  submit(params) {
    return request({
      url: `/v1/finance/payment/batch-submit`,
      method: 'get',
      params
    })
  },
  // 付款单明细
  detail(params) {
    return request({
      url: `/v1/finance/payment/detail`,
      method: 'get',
      params
    })
  },
  // 打印付款单
  printPayment(params) {
    return request({
      url: `/v1/finance/payment/print-payment`,
      method: 'get',
      params
    })
  },
  // 打印付款单明细
  printDetail(params) {
    return request({
      url: `/v1/finance/payment/print-detail`,
      method: 'get',
      params
    })
  },
  // 批量打印
  print(data) {
    return request({
      url: `/v1/finance/payment/batch-print`,
      method: 'post',
      data,
      returnData: true
    })
  },
  // 批量撤回
  back(data) {
    return request({
      url: `/v1/finance/payment/batch-back`,
      method: 'post',
      data,
      returnData: true
    })
  },
  // 出纳驳回
  cashierReject(data) {
    return request({
      url: `/v1/finance/payment/cashier-reject`,
      method: 'post',
      data,
      returnData: true
    })
  },
  // 采购单管理-申请付款
  applyPayment(data) {
    return request({
      url: `/v1/purchase/purchase/apply-payment`,
      method: 'post',
      data
    })
  },
  // 获取选中的采购单信息，申请用
  selectDetail(data) {
    return request({
      url: `/v1/purchase/purchase/select-detail`,
      method: 'post',
      data
    })
  },
  // 获取对账单的采购单信息
  billDetail(data) {
    return request({
      url: `/v1/purchase/purchase/select-detail-by-cb`,
      method: 'post',
      data
    })
  },
  // 修改付款凭证
  editPayment(data) {
    return request({
      url: `/v1/finance/payment/edit-payment-voucher`,
      method: 'post',
      data
    })
  },
  // 获取收款账户数据
  getCollect(data) {
    return request({
      url: `/v1/finance/payment/get-collect`,
      method: 'post',
      data
    })
  },
   // 获取1688交易方式
   getTradeType() {
    return request({
      url: `/v1/purchase/purchase/get-trade-type`,
      method: 'get',
    })
  },
  // 获取1688支付方式
  getPayType() {
    return request({
      url: `/v1/purchase/purchase/get-pay-type`,
      method: 'get',
    })
  },
}
